<template>
  <div id="app">
    <router-view/>
  </div>
</template>

<script src="https://unpkg.com/@vueuse/shared"></script>
<script src="https://unpkg.com/@vueuse/core"></script>
<script>

import Vue from 'vue'

export default {
  name: 'App',
  beforeCreate () {
    this.$store.dispatch('loadStore')
    this.$store.dispatch('pushRoutes')
  },
  created () {
    window.addEventListener('beforeunload', () => {
      window.sessionStorage.setItem('store', JSON.stringify(this.$store.state))
    })
    // 打印一下vue实例
    const c = new Vue()
    console.log(c)
  }
}
</script>

<style>
#app {
}
</style>
